Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@solid-aria/i18n
Advanced tools
Primitives for dealing with locale and layout direction.
I18nProvider
- Provides the locale for the application to all child components.useLocale
- Returns the current locale and layout direction.npm install @solid-aria/i18n
# or
yarn add @solid-aria/i18n
# or
pnpm add @solid-aria/i18n
I18nProvider
I18nProvider
allows you to override the default locale as determined by the browser/system setting with a locale defined by your application (e.g. application setting). This should be done by wrapping your entire application in the provider, which will be cause all child elements to receive the new locale information via useLocale
.
import { I18nProvider } from "@solid-aria/i18n";
function App() {
return (
<I18nProvider locale="fr-FR">
<YourApp />
</I18nProvider>
);
}
useLocale
useLocale
allows components to access the current locale and interface layout direction. By default, this is automatically detected based on the browser or system language, but it can be overridden by using the I18nProvider
at the root of your app.
useLocale
should be used in the root of your app to define the lang and dir attributes so that the browser knows which language and direction the user interface should be rendered in.
import { useLocale } from "@solid-aria/i18n";
function App() {
const locale = useLocale();
return (
<div lang={locale().locale} dir={locale().direction}>
{/* your app here */}
</div>
);
}
All notable changes are described in the CHANGELOG.md file.
FAQs
Primitives for dealing with locale and layout direction.
The npm package @solid-aria/i18n receives a total of 1,012 weekly downloads. As such, @solid-aria/i18n popularity was classified as popular.
We found that @solid-aria/i18n demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.